Skip to content

Conversation

@ngoldbaum
Copy link
Contributor

@ngoldbaum ngoldbaum commented May 8, 2025

Add a blog post describing the work from the nogil team over the past year.

Suggestions for header images to go with this are very appreciated, along with review of the text.

Text styling

  • The blog is written with plain language (where relevant).
  • If there are headers, they use the proper header tags in order to do so (with only one level-one header).
  • All links describe where they link to (for example, check the Quansight labs website).
  • Any kind of styling that the author uses (for example, bold for emphasis) is consistent throughout the blog.

Non-text contents

  • Blog post featured image is in PNG or JPEG format, not SVG.
  • All content is represented as text (for example, images need alt text and videos need captions or descriptive transcripts).
  • If there are emojis, there are not more than three in a row.
  • Don't use flashing gifs or videos.
  • If it were to be read as plain text, the blog still makes sense and no information is missing.

@vercel
Copy link

vercel bot commented May 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
labs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 3:31pm

@nascheme
Copy link
Contributor

nascheme commented May 8, 2025

The performance optimizations to the free-threaded GC are noteworthy, IMHO. The free-threaded build uses it's own cyclic GC implementation. I added two optimizations to the collection process in 3.14: mark-alive pass and pre-fetching (used only within mark-alive pass).

Times below are from my "gc_big_tree.py" benchmark. The performance benefit will depend on the workload and this benchmark is kind of a best case scenario (large and complex object graph, causing traversal to visit many scattered locations in memory).

config create time [ms] collect time [ms] speedup
base 32,178 897
mark-alive 30,886 488 1.8
pre-fetch 30,983 365 2.5

It was a small piece of code but the deferring of full collections also can give a significant speedup. On the toy list append benchmark in the issue, it makes it run 10 times faster (0.2 seconds vs 2 seconds).

python/cpython#133399

Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ngoldbaum! Looks good! I left some comments inline.

Also, one "bigger" suggestion: Could we may be more succinct in describing what free-threaded Python is? There's loads of resources on that everywhere and I'm not sure we should be iterating that here. I think it'd be best if we only provided a very very high-level overview (effectively before: GIL was protecting us, now: it isn't) and then link to one of those resources, maybe even @rgommers's blog post from last year.

@ngoldbaum
Copy link
Contributor Author

ngoldbaum commented May 9, 2025

I threw in an image from the talk but I don't think it looks very good in the blog. Would very much appreciate alternate suggestions for graphics.

@kumaraditya303
Copy link
Contributor

I threw in an image from the talk but I don't think it looks very good in the blog. Would very much appreciate alternate suggestions for graphics.

How about adding one of graphs I posted about scaling asyncio across threads? The blogpost mentions scaling of asyncio so adding that would be good to have.

@ngoldbaum
Copy link
Contributor Author

How about adding one of graphs I posted about scaling asyncio across threads? The blogpost mentions scaling of asyncio so adding that would be good to have.

Thanks for the suggestion. I ended up going with a bit of AI-generated art - I felt like having graphs at the top of the post would distract a bit. We should highlight your work on asyncio in its own blog post IMO.

Apply suggestions from code review

Co-authored-by: gabalafou <[email protected]>
Co-authored-by: Lysandros Nikolaou <[email protected]>

respond to review, add image

add link to PyCon abstract

use a different image and add link to meta blog post

use a smaller image
Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Α few more suggestions from a second read and I think it's good to go.

Co-authored-by: Lysandros Nikolaou <[email protected]>
Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go on my end!

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ngoldbaum & all reviewers! This looks about ready to go. I pushed some minor editorial edits, and there's one larger thing that deserves some attention: it's important to not claim too much of the credit and say "we have ...." unless it was actually us. I made two suggested edits that should address this. I think we've done something like 50% of all the heavy lifting over the past year on widely used OSS packages, so let's recognize that other half.

@ngoldbaum
Copy link
Contributor Author

Done, thanks for the dose of humility!

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, in it goes - should be live in 5 minutes or so!

@rgommers rgommers merged commit 258a526 into Quansight:main May 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants